package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.AboutUsDaoImpl;
import com.ysd.dao.impl.CompenyDaoImpl;
import com.ysd.entity.AboutUs;
import com.ysd.entity.Compeny;


public class AboutServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//调用实现类创建的方法
		CompenyDaoImpl cDao = new CompenyDaoImpl();
		//从数据库获取的数据
		Compeny c = cDao.getCompeny();
		//存入数据
		request.setAttribute("c",c);
		
		AboutUsDaoImpl about = new AboutUsDaoImpl();
		List<AboutUs> ab = about.getAboutUs();
		request.setAttribute("ab", ab);
		//转发
		request.getRequestDispatcher("about.jsp").forward(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		doGet(request, response);
	}

}
